<?php

namespace Api\Member\ApiPass;

use Api\RouteRegistrar;
use Illuminate\Support\ServiceProvider as BaseServiceProvider;

class ServiceProvider extends BaseServiceProvider
{
    /**
     * 服务启动时执行
     * @param  Api\RouteRegistrar $api
     * @return void
     */
    public function boot(RouteRegistrar $api)
    {
        // 注册路由
        $this->registRoute($api);

    }

    /**
     * 注册路由
     * @param  Api\RouteRegistrar $api
     * @return void
     */
    private function registRoute(RouteRegistrar $api)
    {
        // 前台可用
        $api->member('v1', function ($api) {
            $api->post('commit', Open\Controller::class . '@commit');
            $api->get('query' , Open\Controller::class . '@query');
        });
    }

}
